'use strict';

/* Controllers */
  // signin controller
app.controller('paymentListController', ['$scope', '$http', '$state', '$modal', 'user_info', function($scope, $http, $state, $modal, user_info) {
    $scope.loading = true;
    $scope.currentPage = 1;
    $scope.list = null;
    $scope.totalItem = 0;
    $scope.getPage = function(){
        $scope.loading = true;
        $http.get('/app/api/user/payment/list/' + $scope.currentPage)
            .then(function(response) {
                $scope.loading = false;
                let result = response.data.data;
                $scope.list = result.list;
                $scope.totalItem = result.totalItem;
            }, function(x) {

            });
    };
    user_info.check($scope).then(function(){
        $scope.getPage();
    });
}]);